-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(browser): Expose AI instrumentation methods #17848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(browser): Expose AI instrumentation methods #17848
Conversation
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I had a suggestion for the test setup but feel free to tackle it in a follow-up PR.
Also, let's make sure we document the integraitons, including the CDN addon bundles, in our integrations docs pages.
const mockClient = new MockAnthropic({ | ||
apiKey: 'mock-api-key', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m: It isn't ideal for an integration test to mock the client we want to instrument. In our Node integration tests we usually test against the actual libraries (though not sure about AI packages to be fair).
I'm not sure if this works out of the box but we can try adding the packages as dependencies to the browser-integration-tests package.json and then just importing them in the subject files. We bundle each individual integration test suite via webpack so maybe webpack can actually resolve and bundle the dependencies out of the box. If this doesn't work, we should find a way to make this possible. I'm sure this is also a concern for logging libraries used in browser apps.
I'm fine though with merging the PR as-is and following up with replacing the mocks with the actual test apps. Whatever works for you better :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We mock the server apis for AI tests usually, yep can do in a follow up, will draft a ticket for this.
…-expose-ai-integrations-in-browser-sdk feat(browser): Expose AI instrumentation methods
We are exposing AI instrument methods for Anthropic, Google GenAI, and OpenAI, enabling users to use it directly from browser sdk.